#!/bin/bash

if [[ $STAGE == precluster ]]; then
	oracle=`cat /opt/view/rlec/ORACLE.ip`
	printf "\n$oracle oracle\n" >> /etc/hosts

	cd /opt
	ln -s /opt/view/RedisGears/recipes/write_behind recipe

	/opt/recipe/oracle/install-oracle-client
	/opt/recipe/oracle/install-oracle-python-client

elif [[ $STAGE == postcluster ]]; then
	/opt/recipe/oracle/rlec-docker/create-db || exit 1
	ID=1 /opt/recipe/oracle/rlec-docker/start-gear
fi

exit 0
